USE [RD_COMMON]
GO

/****** Object:  Table [dbo].[AR_Star_Customer]    Script Date: 04/02/2010 10:04:25 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[AR_Star_Customer](
	[CustomerNumberID] [bigint] NOT NULL,
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[CustomerNumber] [int] NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[CustomerName] [char](40) NOT NULL,
	[BillToNumber] [int] NOT NULL,
	[BillToName] [char](40) NOT NULL,
	[BillToAddressLine01] [char](40) NOT NULL,
	[BillToAddressLine02] [char](40) NOT NULL,
	[BillToAddressLine03] [char](40) NOT NULL,
	[BillToAddressLine04] [char](40) NOT NULL,
	[BillToPostalCode] [char](12) NOT NULL,
	[BillToCity] [char](25) NOT NULL,
	[BillToStateCode] [char](3) NOT NULL,
	[BillToState] [char](30) NOT NULL,
	[BillToCountryCode] [char](3) NOT NULL,
	[BillToCountry] [char](30) NOT NULL,
	[BillToCounty] [char](25) NOT NULL,
	[ParentNumber] [int] NOT NULL,
	[ParentName] [char](40) NOT NULL,
	[ParentAddressLine01] [char](40) NOT NULL,
	[ParentAddressLine02] [char](40) NOT NULL,
	[ParentAddressLine03] [char](40) NOT NULL,
	[ParentAddressLine04] [char](40) NOT NULL,
	[ParentPostalCode] [char](12) NOT NULL,
	[ParentCity] [char](25) NOT NULL,
	[ParentCounty] [char](25) NOT NULL,
	[ParentStateCode] [char](3) NOT NULL,
	[ParentState] [char](30) NOT NULL,
	[ParentCountry] [char](30) NOT NULL,
	[ParentCountryCode] [char](3) NOT NULL,
	[AlternatePayer] [int] NOT NULL,
	[AverageDaysToPay] [int] NOT NULL,
	[AmountInvoicedThisYear] [decimal](20, 7) NOT NULL,
	[LastPaidAmount] [decimal](20, 7) NOT NULL,
	[DateLastPaid] [datetime] NOT NULL,
	[RelatedAddressNumber] [int] NOT NULL,
	[CreditLimit] [decimal](20, 7) NOT NULL,
	[RouteCode] [char](3) NOT NULL,
	[ROUTECODEDescription] [varchar](255) NOT NULL,
	[HoldOrdersCode] [char](2) NOT NULL,
	[HOLDORDERSCODEDescription] [varchar](255) NOT NULL,
	[StopCode] [char](3) NOT NULL,
	[DELIVERYDAY] [varchar](255) NOT NULL,
-- ADDED for HDAR hold invoice	
	HoldInvoices [char] (1) not null,
-- end of addition
	[Category01Code] [char](3) NOT NULL,
	[Category01] [varchar](255) NOT NULL,
	[Category02Code] [char](3) NOT NULL,
	[Category02] [varchar](255) NOT NULL,
	[Category03Code] [char](3) NOT NULL,
	[Category03] [varchar](255) NOT NULL,
	[Category04Code] [char](3) NOT NULL,
	[Category04] [varchar](255) NOT NULL,
	[Category05Code] [char](3) NOT NULL,
	[Category05] [varchar](255) NOT NULL,
	[Category06Code] [char](3) NOT NULL,
	[Category06] [varchar](255) NOT NULL,
	[Category07Code] [char](3) NOT NULL,
	[Category07] [varchar](255) NOT NULL,
	[Category08Code] [char](3) NOT NULL,
	[Category08] [varchar](255) NOT NULL,
	[Category09Code] [char](3) NOT NULL,
	[Category09] [varchar](255) NOT NULL,
	[Category10Code] [char](3) NOT NULL,
	[Category10] [varchar](255) NOT NULL,
	[Category11Code] [char](3) NOT NULL,
	[Category11] [varchar](255) NOT NULL,
	[Category12Code] [char](3) NOT NULL,
	[Category12] [varchar](255) NOT NULL,
	[Category13Code] [char](3) NOT NULL,
	[Category13] [varchar](255) NOT NULL,
	[Category14Code] [char](3) NOT NULL,
	[Category14] [varchar](255) NOT NULL,
	[Category15Code] [char](3) NOT NULL,
	[Category15] [varchar](255) NOT NULL,
	[Category16Code] [char](3) NOT NULL,
	[Category16] [varchar](255) NOT NULL,
	[Category17Code] [char](3) NOT NULL,
	[Category17] [varchar](255) NOT NULL,
	[Category18Code] [char](3) NOT NULL,
	[Category18] [varchar](255) NOT NULL,
	[Category19Code] [char](3) NOT NULL,
	[Category19] [varchar](255) NOT NULL,
	[Category20Code] [char](3) NOT NULL,
	[Category20] [varchar](255) NOT NULL,
	[Category21Code] [char](3) NOT NULL,
	[Category21] [varchar](255) NOT NULL,
	[Category22Code] [char](3) NOT NULL,
	[Category22] [varchar](255) NOT NULL,
	[Category23Code] [char](3) NOT NULL,
	[Category23] [varchar](255) NOT NULL,
	[Category24Code] [char](3) NOT NULL,
	[Category24] [varchar](255) NOT NULL,
	[Category25Code] [char](3) NOT NULL,
	[Category25] [varchar](255) NOT NULL,
	[Category26Code] [char](3) NOT NULL,
	[Category26] [varchar](255) NOT NULL,
	[Category27Code] [char](3) NOT NULL,
	[Category27] [varchar](255) NOT NULL,
	[Category28Code] [char](3) NOT NULL,
	[Category28] [varchar](255) NOT NULL,
	[Category29Code] [char](3) NOT NULL,
	[Category29] [varchar](255) NOT NULL,
	[Category30Code] [char](3) NOT NULL,
	[Category30] [varchar](255) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
	[DateOfFirstInvoice] [bigint] NULL,
	[LastInvoiceDate] [bigint] NULL,
	[LastStatementDate] [bigint] NULL,
 CONSTRAINT [PK_AR_Star_Customer] PRIMARY KEY CLUSTERED 
(
	[CustomerNumberID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


